package com.food.dao.service;

import java.util.List;

import com.food.dao.MbproductDAOJdbc;
import com.food.dao.in.MbproductDAO;
import com.food.model.Mbproduct;

public class MbproductService {
	MbproductDAO dao = new MbproductDAOJdbc();
	
	public Mbproduct addMbproduct(Integer mbid, Integer pid) {
		
		Mbproduct mbproduct = new Mbproduct();
		
		mbproduct.setMbid(mbid);
		mbproduct.setPid(pid);
		
		dao.insertMbProduct(mbproduct);

		return mbproduct;
	}
	
	public void insertMbProduct(Mbproduct bean){
		dao.insertMbProduct(bean);
	}

	public List<Mbproduct> findAllMbProduct(){
		return dao.findAllMbProduct();
	}

	public List<Mbproduct> findProductByMb(Mbproduct bean){
		return dao.findProductByMb(bean.getMbid());
	}

	public List<Mbproduct> findMbByProduct(Mbproduct bean){
		return dao.findMbByProduct(bean.getPid());
	}
	
	
	public void deleteMbProduct (Mbproduct bean){
		dao.deleteMbProduct(bean.getMbpid());
	}

}
